<?php 
	$this->headScript()->appendFile($this->dirJs.'/jquery.dd.js');
	$this->headLink()->appendStylesheet($this->baseUrl('/public/css/dd.css'));
	$this->headLink()->appendStylesheet($this->dirCss.'/mainstyle.css')
					 ->appendStylesheet($this->dirCss.'/employer_signup.css');
	echo $this->render('common/header.phtml');
?>
<?php 
	if(isset($this->message))
		echo $this->render('common/templatemessage.phtml');
	else{
?>
	<div id="main-content-wrapper">
	
		<div id="main-content">
			<form action="" id="register-form" method="post">
				<div id="register-pic-frame">
					<img src="<?php echo $this->dirImg.'/employer-pic1.png'; ?>" alt="" />
					<img src="<?php echo $this->dirImg.'/employer-pic2.png'; ?>" alt="" />
					<img src="<?php echo $this->dirImg.'/employer-pic3.png'; ?>" alt="" />
				</div><!--  END #register-pic-frame -->
				
				<div id="employer-signup-wrapper">
					<p class="signup-bigtitle">Employer Sign Up</p>
					<p class="top-des">Interested in hiring a talented, self motivated unpaid intern at no cost to your organization?</p>
					
					<p class="topic-title">1- Login Information</p>
					<label for="employer[email]" class="signup-label">Email address</label>
					<input type="text" class="signup-textbox-long" name="employer[email]" id="email" autofocus="autofocus" value="<?php echo @$this->formData['employer']['email']; ?>"/>
					<?php if(!empty($this->error_list[0])){?>
						<label class="reg-error"><?php echo $this->error_list[0]; ?></label>
					<?php }elseif(!empty($this->error_list[1])){?>
						<label class="reg-error"><?php echo $this->error_list[1]; ?></label>
					<?php }?>
					<div class="clear_row"></div>
					
					<label for="employer[password]" class="signup-label">Password</label>
					<input type="password" class="signup-textbox-short" name="employer[password]" id="password" value="<?php echo @$this->formData['employer']['password']; ?>"/> <span class="signup-tip">6 - 32 characters</span>
					<?php if(!empty($this->error_list[2])){?>
						<label class="reg-error"><?php echo $this->error_list[2]; ?></label>
					<?php }elseif(!empty($this->error_list[4])){?>
						<label class="reg-error"><?php echo $this->error_list[4]; ?></label>
					<?php }?>
					
					<div class="clear_row"></div>
					<label for="passwordconfirm" class="signup-label">Confirm password</label>
					<input type="password" class="signup-textbox-short" name="passwordconfirm" id="passwordconfirm" value="<?php echo @$this->formData['passwordconfirm']; ?>"/>
					<?php if(!(empty($this->error_list[3]))){?>
						<label class="reg-error"><?php echo $this->error_list[3]; //'Confirm password does not match'?></label>
					<?php }?>
					<div class="clear_row"></div>
					
					<p class="topic-title">2- Contact Information</p>
					<p class="topic-title-des">(Information below will be used for communication between you and Thamza)</p>
					<label for="employer[contactname]" class="signup-label">Contact name</label>
					<input type="text" class="signup-textbox-long" name="employer[contactname]" id="contactname" value="<?php echo $this->formData['employer']['contactname'] ;?>"/>
					<?php if(!empty($this->error_list[6])){?>
						<label class="reg-error"><?php echo $this->error_list[6]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<label for="employer[mobile]" class="signup-label">Mobile</label>
					<input type="text" class="signup-textbox-short" name="employer[mobile]" id="mobile" value="<?php echo $this->formData['employer']['mobile'] ;?>"/>
					<?php if(!empty($this->error_list[7])){?>
						<label class="reg-error"><?php echo $this->error_list[7]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					
					<p class="topic-title">3- Company Information</p>
					<label for="employer[companyname]" class="signup-label">Company name</label>
					<input type="text" class="signup-textbox-long" name="employer[companyname]" id="companyname"  value="<?php echo $this->formData['employer']['companyname'] ;?>" />
					<?php if(!empty($this->error_list[8])){?>
						<label class="reg-error"><?php echo $this->error_list[8]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<label for="employer[companyaddress]" class="signup-label">Company address</label>
					<input type="text" class="signup-textbox-short" name="employer[companyaddress]" id="companyaddress" value="<?php echo $this->formData['employer']['companyaddress'] ;?>"/>
					<?php if(!empty($this->error_list[9])){?>
						<label class="reg-error"><?php echo $this->error_list[9]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<label for="companysize" class="signup-label">Company size</label>
					<select class="signup-select-short" name="employer[companysize_id]" id="companysize">
					<?php foreach($this->com_size as $oneSize){
						if($this->formData['companysize'] != $oneSize['id']){
					?>
						<option value="<?php echo $oneSize['id'];?>"><?php echo $oneSize['name'];?></option>
					<?php }else{?>
						<option selected="selected" value="<?php echo $oneSize['id'];?>"><?php echo $oneSize['name'];?></option>
					<?php }}?>
					
					</select>
					<?php if(!empty($this->error_list[10])){?>
						<label class="reg-error" style="clear:left; margin-top:-7px;"><?php echo $this->error_list[10]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<label for="employer[companysite]" class="signup-label">Website</label>
					<input type="text" class="signup-textbox-short" name="employer[companysite]" id="companysite" value="<?php echo $this->formData['employer']['companysite'] ;?>"/>
					<?php if(!empty($this->error_list[11])){?>
						<label class="reg-error"><?php echo $this->error_list[11]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<label for="companyprofile" class="signup-label">Company profile</label>
					<textarea class="signup-textbox-long" rows="10" cols="" name="employer[companyprofile]" id="companyprofile"><?php echo $this->formData['employer']['companyprofile'] ;?></textarea>
                    <?php if(!empty($this->error_list[12])){?>
						<label class="reg-error"><?php echo $this->error_list[12]; ?></label>
					<?php } ?>
					<div class="clear_row"></div>
					
					<span class="condition-wrapper">
						<?php if(empty($this->formData['condition']) || $this->formData['condition'] == "agree"){ ?>
							<input type="hidden" value="agree" name="condition" id="term"/>
							<img align="left" src="<?php echo $this->dirImg.'/checked.png'; ?>" alt="agree" />
						<?php }elseif($this->formData['condition'] == "disagree"){?>
							<input type="hidden" value="disagree" name="condition" id="term"/>
							<img align="left" src="<?php echo $this->dirImg.'/unchecked.png'; ?>" alt="disagree" />
						<?php }?>
						
						<label class="condition-content">I have read the <a href="javascript:" class="notice-important">Terms and Conditions</a> and agree to be bound by them.</label>
						<br/><br/>
						<?php if(!empty($this->error_list[5])){?>
						<label  class="reg-error" style="margin:0; margin-top:-10px"><?php echo $this->error_list[5]; ?></label>
						<?php } ?>
					</span>
					
					<div class="signup-label"></div>
					<div class="signup-textbox-long">
						<a class="signup-btn" href="javascript:" >
							<img src="<?php echo $this->dirImg.'/signup-btn.png'; ?>" alt="" />
						</a>
					</div>
				</div><!--  END #employer-signup-wrapper -->
			</form>
		</div><!--  END #main-content -->
    </div><!-- END # -->
<script type="text/javascript">
	$(document).ready(function(){
		$("#companysize").msDropDown();
		$('.condition-wrapper').click(function(){
			//Xử lý cho nút check box term and condition
			var agree= "<?php echo $this->dirImg.'/checked.png'?>";
			var disagree= "<?php echo $this->dirImg.'/unchecked.png'?>";
			var src = $('#term').val();
			if(src == 'agree'){
				$('#term').val('disagree');
				$('.condition-wrapper img').attr('src',disagree);
			}else{
				$('#term').val('agree');
				$('.condition-wrapper img').attr('src',agree);
			}
		});
		$('.signup-btn').click(function(){
			$('#register-form').submit();
		});
	});
</script>

<?php } ?>
<?php echo $this->render('common/footer.phtml'); ?>